;
(function() {

	//TODO:除了安全性的分装，还要有通知系统的辅助，将通知发布到相应模块
	var admin_skill = {
		//角色类别标识
		league_role: "admin",
		//添加活动
		addActivity: function(activityInfo) {
			var league = this.getLeague();
			var activity = new ActivityCon(activityInfo);
			league._addAvtivity(activity._id);
		},
		//删除活动
		removeActivity: function(activity_id) {
			var league = this.getLeague();
			league._removeActivity(activity_id);
		},
		//修改活动
		updateActivity: function(activity_id, activityInfo) {
			var league = this.getLeague();
			league._updateActivity(activity_id, activityInfo);
		},
		//添加销售
		addMarket: function(marketInfo) {
			var market = new MarketCon(marketInfo);
			var league = this.getLeague();
			league._addMarket(market._id);
		},
		//删除销售
		removeMarket: function(market_id) {
			var league = this.getLeague();
			league._removeMarket(market._id);
		},
		//修改销售
		updateMarket: function(market_id, marketInfo) {
			var league = this.getLeague();
			league._updateMarket(market._id, marketInfo);
		},
		//批量添加商家
		addMerchants: function(bus_ids) {
			var league = this.getLeague();
			bus_ids.forEach(function(bus_id) {
				league._addMerchant(bus_id);
			});
		},
		//批量移除商家
		removeMerchants: function(bus_ids) {
			var league = this.getLeague();
			bus_ids.forEach(function(bus_id) {
				league._removeMerchant(bus_id);
			});
		},
	};
	module.exports = admin_skill;

	var merchant_skill = require("./merchant.skill");

	Object.keys(merchant_skill).forEach(function(key) {
		admin_skill[key] || (admin_skill[key] = merchant_skill[key]);
	});
}());